package com.it.elmboot.service.impl;

import com.it.elmboot.mapper.UserMapper;
import com.it.elmboot.pojo.User;
import com.it.elmboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public boolean saveUser(User user) {
       Boolean isExist= userMapper.getUserById(user.getUserId());
       if(isExist)return false;
       else{
           return userMapper.insertUser(user);
       }

    }

    @Override
    public User getUserByIdByPass(User user) {
        return userMapper.getUserByIdByPass(user);
    }
}
